package tech.aistar.mapper;

import org.apache.ibatis.annotations.*;
import tech.aistar.pojo.Refund;

@Mapper
public interface RefundMapper {

    //根据if查询
    @Select("select *from refund where id=#{id}")
    Refund getById(Integer id);

    @Insert("insert into  refund(order_id,refund_amount,reason,status,create_time) values(#{orderId},#{refundAmount},#{reason},#{status},#{createTime});")
    int insert(Refund record);

    //根据id删除
    @Delete("delete from  refund where id=#{value}")
    int delete(Integer id);

    @Update("update refund set order_id=#{orderId},refund_amount=#{refundAmount},reason=#{reason},status=#{status},create_time=#{createTime} where id=#{id}")
    int update(Refund record);
}
